﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using WeifenLuo.WinFormsUI.Docking;

namespace Mole
{
    public partial class FrmPicturesView : DockContent
    {

        public String[] _filepath;
        public List<DirectoryList> _dirlist;
        public int _position = 0;
        public DockPanel _dockPanelMain;

        public FrmPicturesView()
        {
            InitializeComponent();
        }

        public void LoadPicture(Int32 position)
        {
            int count = _filepath.Length - 1;

            if (position < 0)
            {
                return;
            }

            if (position > count)
            {
                return;
            }
            
            _position = position;
            label1.Text = String.Format("{0} of {1}", _position, count);
            pictureBox1.Image = new Bitmap(_filepath[position]);
        }

        public void LoadPictureList(Int32 position)
        {
            int count = _dirlist.Count - 1;

            if (position < 0)
            {
                return;
            }

            if (position > count)
            {
                return;
            }

            _position = position;
            label1.Text = String.Format("{0} of {1}", _position, count);

            tbURL.Text = _dirlist[position].SiteUrl;
            tbFile.Text = _dirlist[position].FilePath;

            pictureBox1.Image = new Bitmap(_dirlist[position].FilePath);

        }
        

        private void button1_Click(object sender, EventArgs e)
        {
            LoadPictureList(_position + 1);
        }

        private void button2_Click(object sender, EventArgs e)
        {
            LoadPictureList(_position - 1);
        }

    }
}
